I am using validation controls in asp.net application, I got this following webforms unobtrusivevalidationmode error while running the application.
“WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).”
Aspx Codes(Html ):
<form id="form1" runat="server">
<div>
<table align="center" style="border: 1px solid #dbcece">
<tr>
<td colspan="3"
style="text-align: center; font-weight: 700; border-bottom-style: solid;
border-bottom-width: thin; border-bottom-color: #008080;">User Login Area</td>
</tr>
<tr>
<td > </td>
<td > </td>
<td> </td>
</tr>
<tr>
<td >UserName :</td>
<td >
<asp:TextBox ID="txtusername" runat="server" Width="120px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtusername" ErrorMessage="Please, enter username"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td >Password :</td>
<td >
<asp:TextBox ID="txtpassword" runat="server" TextMode="Password" Width="120px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtpassword" ErrorMessage="Please, enter password"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td > </td>
<td >
<asp:Button ID="btnlogin" runat="server" OnClick="btnlogin_Click"
Text="Login" />
</td>
<td> </td>
</tr>
<tr>
<td > </td>
<td colspan="2">
<asp:Label ID="lblmsg" runat="server"></asp:Label>
</td>
</tr>
</table>
</div>
</form>
Solution: Here, I am using asp validation on the design page,so that we need to enable the validation mode in the web.config file. Add key and value in the appsetting like this,
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
If you set an unobtrusiveValidation mode to none(default), the asp.net application will use the pre 4.5 behavior for client side validation. If you set the key value to web forms, the application will use the HTML5 attributes for client side validation.
Post your comments / questions
Recent Article
- How to create custom 404 error page in Django?
- Requested setting INSTALLED_APPS, but settings are not configured. You must either define..
- ValueError:All arrays must be of the same length - Python
- Check hostname requires server hostname - SOLVED
- How to restrict access to the page Access only for logged user in Django
- Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default
- Add or change a related_name argument to the definition for 'auth.User.groups' or 'DriverUser.groups'. -Django ERROR
- Addition of two numbers in django python
Related Article